// import QtQuick 1.0 // to target S60 5th Edition or Maemo 5
import QtQuick 1.1

MouseArea {
    id: root

    signal cliqueUnico(variant mouse)
    signal cliqueDuplo(variant mouse)

    property bool holdon : false
    property variant mouseEvents

    onClicked: {
        if (root.holdon) {
            meuTimer.stop();
            root.holdon = false;
            root.cliqueDuplo(mouse)
        } else {
            root.mouseEvents = mouse
            root.holdon = true;
            meuTimer.restart();
        }
    }

    Timer {
        id: meuTimer
        running: false
        triggeredOnStart: false
        interval: 500
        onTriggered: {
            root.holdon = false
            root.cliqueUnico(root.mouseEvents)
        }
    }
}
